/**
  ******************************************************************************
  * @file           : ble_handler.h
  * @author			: duanzhe
  * @brief          : BLE数据处理任务头文件
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 乐普医电.
  *
  ******************************************************************************
  */
#ifndef __BLE_HANDLER_H
#define __BLE_HANDLER_H

#include "main.h"

#define BLE_TX_TIMEOUT         			(100*1000/CFG_TS_TICK_VAL) /**< 100ms */
#define BLE_RX_TIMEOUT                  (3000*1000/CFG_TS_TICK_VAL) /**< 3s */

extern uint16_t ble_rx_data_length;
extern uint8_t ble_rx_pack_num;
extern uint8_t ble_rx_data[4096];

extern uint8_t ble_tx_timertask_id;
extern uint8_t ble_rx_timeout_id;

void ble_data_receive(void);
void ble_data_transmit(void);


uint8_t User_BleTransmit(uint8_t* ble_data, uint16_t NumData);
void User_BleReceive_Handler(uint8_t* ble_rxdata, uint16_t data_length);


void ble_tx_timertask(void);
void ble_rx_timeout_handler(void);


#endif
